"set runtimepath=~/.config/vim,$VIMRUNTIME
source ~/.vim/base.vim
source ~/.vim/styles.vim
source ~/.vim/keymaps.vim

let g:lightline = {
      \ 'colorscheme': 'dracula',
      \ }


" 创建文件时添加头部信息
function! AddShHeader()
  if getline(1) == ""
    call setline(1, "#!/bin/bash")
    call append(1, "# Date: " . strftime("%Y-%m-%d %H:%M:%S"))
    call append(2, "") " Add an empty line after the header
    normal! G
  endif
endfunction
" Auto command to trigger the function when a new .sh file is created
augroup sh_file_header
  autocmd!
  autocmd BufNewFile *.sh call AddShHeader()
augroup END


" nerdtree插件设置
nnoremap <space>e :NERDTreeToggle<CR>
autocmd FileType nerdtree nmap <buffer> l go



